package com.stoken.dao;

import org.hibernate.Criteria;
import org.hibernate.Hibernate;
import org.hibernate.criterion.Property;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;

import com.stoken.domain.TypeLineInfo;
import com.symbio.commons.Page;
import com.symbio.dao.hibernate.GenericDaoImpl;
import com.symbio.utils.HibernateUtils;

/**
 * 旅游线路表
 * @author Fred
 *
 */
@Repository
public class TypeLineInfoDao extends GenericDaoImpl<TypeLineInfo, Long> {
	
	public Page<TypeLineInfo> findListByLineType(Page<TypeLineInfo> pageData,String typeLabel){		
		
		Criteria criteria = HibernateUtils.createCriteria(getSession(), entityClass);
		
		criteria.createAlias("lineType", "line",Criteria.INNER_JOIN, Restrictions.eq("line.typeLabel", typeLabel)); 	
	
		
		HibernateUtils.setParameter(criteria, pageData);
		
		pageData.setResult(criteria.list());
		
		return pageData;		
	}
}
